home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / JCurrencyTextFieldBeanInfo.java < prev    next >
Text File  |  1998-10-26  |  6KB  |  125 lines

  1. package com.symantec.itools.swing;
  2.  
  3. import java.beans.*;
  4. import java.util.ResourceBundle;
  5. import com.symantec.itools.swing.DesignTimeResourceBundle;
  6. import com.symantec.itools.vcafe.beans.*;
  7. import com.symantec.itools.vcafe.beans.PropertyDescriptorAttributes;
  8.  
  9. //  08/19/98    LAB    Moved to GroupAWTAdditions folder.
  10. //  10/06/98    VJ    Added code for grouping together currency properties
  11.  
  12. public class JCurrencyTextFieldBeanInfo extends com.symantec.itools.beans.HelperBeanInfo {
  13.   public JCurrencyTextFieldBeanInfo()
  14.     {
  15.         setInheritSuperBeanInfo(true);
  16.  
  17.         ResourceBundle resources = ResourceBundle.getBundle("com.symantec.itools.swing.DesignTimeResourceBundle");
  18.         String folderName = resources.getString(DesignTimeResourceBundle.SWING_ADDITIONS_FOLDER_TOOLBAR_KEY);
  19.         setComponentLibraryFolder(folderName);
  20.         setToolbarFolder(folderName);
  21.  
  22.         setWinHelpKey(m_WinHelpID);
  23.     }
  24.  
  25.     protected Class getBeanClass()
  26.     {
  27.         return JCurrencyTextField.class;
  28.     }
  29.  
  30.  
  31.  
  32.     /**
  33.      * Gets an image that may be used to visually represent this bean
  34.      * (in the toolbar, on a form, etc).
  35.      * @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
  36.      * BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
  37.      * @return an image for this bean, always color even if requested monochrome
  38.      * @see BeanInfo#ICON_MONO_16x16
  39.      * @see BeanInfo#ICON_COLOR_16x16
  40.      * @see BeanInfo#ICON_MONO_32x32
  41.      * @see BeanInfo#ICON_COLOR_32x32
  42.      */
  43.     public java.awt.Image getIcon(int iconKind) {
  44.     java.awt.Image img = null;
  45.     switch (iconKind) {
  46.         case BeanInfo.ICON_MONO_16x16:
  47.         case BeanInfo.ICON_COLOR_16x16:
  48.             img = loadImage("jcurrency16.gif");
  49.             break;
  50.         case BeanInfo.ICON_MONO_32x32:
  51.         case BeanInfo.ICON_COLOR_32x32:
  52.             img = loadImage("jcurrency32.gif");
  53.         }
  54.         return img;
  55.     }
  56.     
  57.     //VJ start
  58.     public PropertyDescriptor[] getPropertyDescriptors() {
  59.         try{
  60.             /*
  61.             DataText should not be exposed - Puru (10/26/98)
  62.         PropertyDescriptor dataText = new PropertyDescriptor("dataText", getBeanClass(),"getDataText",null);
  63.         dataText.setBound(false);
  64.         dataText.setConstrained(false);
  65.         dataText.setDisplayName("Data Text");
  66.         dataText.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  67.         dataText.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_DATA_TEXT_HELP_ID));
  68.             */
  69.  
  70.         PropertyDescriptor decimalPoint = new PropertyDescriptor("decimalPoint", getBeanClass());
  71.         decimalPoint.setBound(false);
  72.         decimalPoint.setConstrained(false);
  73.         decimalPoint.setDisplayName("Decimal Point");
  74.         decimalPoint.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  75.         decimalPoint.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_DECIMAL_POINT_HELP_ID));
  76.  
  77.         PropertyDescriptor digitsAfterDecimal = new PropertyDescriptor("digitsAfterDecimal", getBeanClass());
  78.         digitsAfterDecimal.setBound(false);
  79.         digitsAfterDecimal.setConstrained(false);
  80.         digitsAfterDecimal.setDisplayName("Digits After Decimal");
  81.         digitsAfterDecimal.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  82.         digitsAfterDecimal.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_DIGITS_AFTER_DECIMAL_HELP_ID));
  83.  
  84.         PropertyDescriptor currencyLeading = new PropertyDescriptor("currencyLeading", getBeanClass());
  85.         currencyLeading.setBound(false);
  86.         currencyLeading.setConstrained(false);
  87.         currencyLeading.setDisplayName("Leading Symbol");
  88.         currencyLeading.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  89.         currencyLeading.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_LEADING_SYMBOL_HELP_ID));
  90.  
  91.         PropertyDescriptor separator = new PropertyDescriptor("separator", getBeanClass());
  92.         separator.setBound(false);
  93.         separator.setConstrained(false);
  94.         separator.setDisplayName("Separator");
  95.         separator.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  96.         separator.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_SEPARATOR_HELP_ID));
  97.  
  98.         PropertyDescriptor separatorEnabled = new PropertyDescriptor("separatorEnabled", getBeanClass());
  99.         separatorEnabled.setBound(false);
  100.         separatorEnabled.setConstrained(false);
  101.         separatorEnabled.setDisplayName("Separator Enabled");
  102.         separatorEnabled.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  103.         separatorEnabled.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_SEPARATOR_ENABLED_HELP_ID));
  104.  
  105.         PropertyDescriptor currencySymbol = new PropertyDescriptor("currencySymbol", getBeanClass());
  106.         currencySymbol.setBound(false);
  107.         currencySymbol.setConstrained(false);
  108.         currencySymbol.setDisplayName("Symbol");
  109.         currencySymbol.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  110.         currencySymbol.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_SYMBOL_HELP_ID));
  111.  
  112.         PropertyDescriptor document = new PropertyDescriptor ("document", getBeanClass ());
  113.         document.setHidden (true);
  114.  
  115.          PropertyDescriptor[] rv = {currencySymbol,currencyLeading,decimalPoint,digitsAfterDecimal,
  116.                                      separator,separatorEnabled,document};
  117.  
  118.         return rv;
  119.         } catch (IntrospectionException e) { throw new Error(e.toString()); }
  120.     }
  121.     //VJ end
  122.  
  123.     protected final static String m_WinHelpID = "0x600FC";
  124. }
  125.